*DO FILE TO REPLICATE ANALYSIS FROM GEOFFREY P.R. WALLACE "WELCOME GUESTS, OR INEVITABLE VICTIMS? THE CAUSES OF PRISONER ABUSE IN WAR"

version 11

use "prisoner_rep.dta", clear

/* 
* Note: To generate tables using the commands listed below user will need to download the -outreg2- ado file for Stata
findit outreg2
*/


*TABLE 1

*Main Model
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) replace ///
	title("Ordered Logit Analysis of the Determinants of Prisoner Abuse in Interstate Wars, 1898-2003") ///
	ctitle("Main Model")

*Democracy-deterrence interaction
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 dem_deterrence, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Democracy X Deterrence")
*Substantive effects
estsimp ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 dem_deterrence, vce(cluster warnum) nolog 
setx mean
setx deterrence 1
simqi fd(pr) changex(democ7 0 1 dem_deterrence 0 1)
setx mean
setx (deterrence dem_deterrence) 0 
simqi fd(pr) changex(democ7 0 1)
drop b1-b15

*Democracy-Reciprocity interaction
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 dem_allcv_2, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Democracy X Reciprocity")
*Substantive effects
estsimp ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 dem_allcv_2, vce(cluster warnum) nolog
setx mean
*Set to medium levels of opponent abuse
setx allcv_2 1
simqi fd(pr) changex(democ7 0 1 dem_allcv_2 0 1)
*High levels of opponent abuse
setx allcv_2 2
simqi fd(pr) changex(democ7 0 1 dem_allcv_2 0 2)
drop b1-b15

*Democracy-attrition interaction
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 dem_attrition2, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Democracy X Attrition")
*Substantive effects
estsimp ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 dem_attrition2, vce(cluster warnum) nolog
setx mean
setx attrition2 1
simqi fd(pr) changex(democ7 0 1 dem_attrition2 0 1)
setx mean
setx (attrition2 dem_attrition2) 0
simqi fd(pr) changex(democ7 0 1)
drop b1-b15

*Democracy-initiator interaction
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 initabd dem_initabd, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Democracy X Initiator")
*Substantive effects
estsimp ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 initabd dem_initabd, vce(cluster warnum) nolog 
setx mean
setx initabd 1
simqi fd(pr) changex(democ7 0 1 dem_initabd 0 1)
setx mean
setx (initabd dem_initabd) 0
simqi fd(pr) changex(democ7 0 1)
drop b1-b16

*Democracy-treaty ratification interaction
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 dem_treaty, vce(cluster warnum) nolog 
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Democracy X Treaty")
*Substantive effects
estsimp ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 dem_treaty, vce(cluster warnum) nolog
setx mean 
setx treaty 1
simqi fd(pr) changex(democ7 0 1 dem_treaty 0 1)
setx (treaty dem_treaty) 0
simqi fd(pr) changex(democ7 0 1)
drop b1-b15

*Democracy post-1949 norms interaction
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 dem_1949dum, vce(cluster warnum) nolog 
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Democracy X Norms")
*Substantive significance
estsimp ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 dem_1949dum, vce(cluster warnum) nolog 
setx mean
setx ydum1949 1
simqi fd(pr) changex(democ7 0 1 dem_1949dum 0 1)
*Do for pre-1949 as well
setx mean
setx (ydum1949 dem_1949dum) 0 
simqi fd(pr) changex(democ7 0 1)
drop b1-b15


*TABLE 2 (SUBSTANTIVE EFFECTS)
estsimp ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d ///
treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog 

*Baseline set all variables to means.
setx mean
simqi
*Democracy
setx democ7 0 
simqi
setx democ7 1
simqi
setx mean
simqi, fd(pr)  changex(democ7 0 1)
*War of Attrition
setx mean
setx attrition2 0
simqi
setx attrition2 1
simqi
setx mean
simqi, fd(pr)  changex(attrition2 0 1)
*Expansive War Aims
setx mean
setx waexpand 0
simqi
setx waexpand 1
simqi
setx mean
simqi, fd(pr)  changex(waexpand 0 1)
*Territorial Annexation
setx mean
setx annex2 0
simqi
setx annex2 1
simqi
setx mean
simqi, fd(pr)  changex(annex2 0 1)
*Cultural Differences
setx mean
setx civdiff 0
simqi
setx civdiff 1
simqi
setx mean
simqi, fd(pr)  changex(civdiff 0 1)
*Prisoner Abuse by Opponent
setx mean
setx allcv_2 1
simqi
setx allcv_2 2
simqi
setx mean
simqi, fd(pr)  changex(allcv_2 1 2)
*Deterrence 
setx mean
setx deterrence 0
simqi
setx deterrence 1
simqi
setx mean
simqi, fd(pr)  changex(deterrence 0 1)
*Relative Capabilities
setx mean
setx relcap_d p10
simqi
setx relcap_d p90
simqi
setx mean
simqi, fd(pr)  changex(relcap_d p10 p90)
*Treaty Ratification
setx mean
setx treaty 0
simqi
setx treaty 1
simqi
setx mean
simqi, fd(pr)  changex(treaty 0 1)
*Treaty Ratification (Opponent)
setx mean
setx treaty_2 0
simqi
setx treaty_2 1
simqi
setx mean
simqi, fd(pr)  changex(treaty_2 0 1)
*Joint Treaty Ratification
setx mean
setx joint_treaty 0
simqi
setx joint_treaty 1
simqi
setx mean
simqi, fd(pr)  changex(joint_treaty 0 1)
*Post-1949 Norms
setx mean
setx ydum1949 0
simqi
setx ydum1949 1
simqi
setx mean
simqi, fd(pr)  changex(ydum1949 0 1)



*VARIOUS ROBUSTNESS CHECKS
*These are based on the baseline Model 1 unless otherwise noted.


*Alternative Measures for Dependent Variable

*Including all states from the data set, not just capable captors.
ologit allcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d ///
treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog 

*Using dichotomous "High prisoner abuse" 
logit capcvhigh democ7 attrition2 waexpand annex2 civdiff allcvhigh_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) replace ///
	title("Alternative Measures for Prisoner Abuse Dependent Variable, 1898-2003") ///
	ctitle("Dichotomous 'High Abuse' Variable") ///
	addnote("For the median value version of prisoner abuse there are four cutpoints in total given how median values are sometimes calculated as averages when there are two equally occurring values that lie between the minimum and the maximum.")

*Model using continuous average measure
regress capcv_avg democ7 attrition2 waexpand annex2 civdiff allcv_2_avg deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum)
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Average Measure (Continuous)")

*Model using categorical average measure
ologit capcv_avgcat democ7 attrition2 waexpand annex2 civdiff allcv_2_avgcat deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Average Measure (Categorical)")

*Model using median measure
ologit capcv_med democ7 attrition2 waexpand annex2 civdiff allcv_2_med deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Median Measure")


*Alternative measures for Regime Type

*Polity cutoff of 6
ologit capcv democ6 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) replace dec(2) ///
	title("Prisoner Abuse and Alternative Measures for Democracy, 1898-2003") ///
	ctitle("Polity 6 Cutoff")

*Alternative Polity cutoff of 8
ologit capcv democ8 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Polity 8 Cutoff")

*Alternative using Doyle's liberal state
ologit capcv liberal attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Doyle's Liberal States")

*Anocracy
ologit capcv anocracy attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) ///
	ctitle("Mixed Regime Dummy")

*Substituting Polity Score and Polity Score squared to assesscurvilinear relationship between regime type and prisoner abuse 
ologit capcv regpol regpol_square attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Assessing Curvilinear Relationship")

	
*Alternative Measures for Attrition and Annexation Variables

*Using original Downes codings for attrition and annexation
ologit capcv democ7 attrition waexpand annex civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) replace dec(2) ///
	title("Prisoner Abuse and Alternative Measures for Attrition and Territorial Annexation, 1898-2003") ///
	ctitle("Original Attrition and Annexation Codings from Downes")

*Substituting the log of battle deaths for attrition
ologit capcv democ7 ln_combdeaths waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Logged Battle Deaths")

*Substituting war duration for attrition 
ologit capcv democ7 ln_duration waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("War Duration")

*Excluding attrition to see if expansive war aims changes since Downes uses latter as alternative measure of former (2007:885).
ologit capcv democ7 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2_p) dec(2) ///
	ctitle("Attrition Excluded")
	

*Including international law variables separate to ensure collinearity is not driving the results.

*Unilateral treaty only
ologit capcv democ7 attrition waexpand annex civdiff allcv_2 deterrence relcap_d /// 
	treaty ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2) replace dec(2) ///
	title("Prisoner Abuse and Alternative Models for International Law, 1898-2003") ///
	ctitle("Ratification Only") 

*Opponent unilateral treaty only
ologit capcv democ7 attrition waexpand annex civdiff allcv_2 deterrence relcap_d /// 
	treaty_2 ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2) dec(2) ///
	ctitle("Opponent Ratification Only") 

*Both but no join_treaty
ologit capcv democ7 attrition waexpand annex civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 ydum1949, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2) dec(2) ///
	ctitle("No Joint Ratification") 


*Assessing problems posed by potential endogeneity in the "Prisoner Abuse by Opponent" Variable.
*	Since the violating state's own prisoner abuse likely affects prisoner treatment by the opponent, the latter variable might be endogenous.
*	Endgoneity may then lead to upwardly biased estimates for the opponent�s abuse coefficient, but may affect other results as well.  
*	To ensure endogeneity was not unduly affecting the results, I constructed an instrument for the opponent abuse variable and re-estimated 
*		the model using two-stage least squares (2SLS)
*	The instrument was constructed using the variables from Model 1, along with the opponent�s values for democracy, attrition, expansive war aims, 
*		annexation, and relative capabilities.)  
*	One of the disadvantages of this approach is a loss of efficiency in the estimator because the instrument tends to be less precise compared to 
*		the original endogenous regressor.
*	Furthermore, the estimator assumes the dependent and endogenous terms are continuous even though both are ordinal. 
*	The results indicate that while the size of the Prisoner Abuse by Opponent coefficient decreases, but remains statistically significant,
*		and the other results are substantially the same.

ivregress 2sls capcv democ7 attrition2 waexpand annex2 civdiff deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 ///
	(allcv_2 = democ7_2 attrition2_2 waexpand_2 annex2_2 relcap_d_2), vce(cluster warnum) first
outreg2 using table1, symbol(**, *, +) nor2 e(ll chi2 r2) replace dec(2) ///
	title("Prisoner Abuse and Consideration of Endogeneity, 1898-2003") ///
	ctitle("Opponent Abuse Endogenized") 
	
	
*Assessing possible country, regime, and war-specific effects

*USA
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 usa, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2) replace dec(2) ///
	title("Prisoner Abuse and Assessing Country, Regime, or War-Specific Effects, 1898-2003") ///
	ctitle("USA Dummy") 

*Nazi Germany
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 nazigermany, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2) dec(2) ///
	ctitle("Nazi Germany")

*Communist
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 communist, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2) dec(2) ///
	ctitle("Communist Dummy") 

*WWI
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 ww1, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2) dec(2) ///
	ctitle("WWI Dummy")

*WWII
ologit capcv democ7 attrition2 waexpand annex2 civdiff allcv_2 deterrence relcap_d /// 
	treaty treaty_2 joint_treaty ydum1949 ww2, vce(cluster warnum) nolog
outreg2 using table1, onecol symbol(**, *, +) nor2 e(ll chi2 r2) dec(2) ///
	ctitle("WWII Dummy")
